<?php

use Cli\Ip;
/**
 * @name IndexController
 * @author asus-pc\asus
 * @desc 默认控制器
 * @see http://www.php.net/manual/en/class.yaf-controller-abstract.php
 */
class IndexController extends BaseController {
	public function init(){
		//$this->getView()->setScriptPath(APPLICATION_PATH."/template");
	}
	/** 
     * 默认动作
     * Yaf支持直接把Yaf_Request_Abstract::getParam()得到的同名参数作为Action的形参
     * 对于如下的例子, 当访问http://yourhost/sample/index/index/index/name/asus-pc\asus 的时候, 你就会发现不同
     */
	public function indexAction($name = "Stranger") {
		$sms = new Api\SendSms\Sms();
		echo $sms->send();
		
		$cli = new Ip(); //new Cli\Ip() 与  new Ip()会在头部 "use Cli\Ip" 都是一样的
		$cli->clisend();
		exit;
		//1. fetch query
		$get = $this->getRequest()->getQuery("get", "default value");

		//2. fetch model
		$model = new SampleModel();

		//3. assign
		$this->getView()->assign("content", $model->selectSample());
		$this->getView()->assign("name", $name);

		//4. render by Yaf, 如果这里返回FALSE, Yaf将不会调用自动视图引擎Render模板
        return TRUE;
	}
}
